/*
 * PanelStatusSinglePlayer.java
 *
 * Created on November 21, 2008, 12:58 PM
 */
package hextd.UI;

import hextd.core.ContextNormal;
import hextd.util.colorSelection;
import javax.swing.SwingUtilities;

/**
 *
 * @author  hylke
 */
public class PanelStatusSinglePlayer extends javax.swing.JPanel {

	ContextNormal context;
	colorSelection colors;
	String bonus, credits, interest, lives, score, wave;

	/** Creates new form PanelStatusSinglePlayer */
	public PanelStatusSinglePlayer() {
	}

	public PanelStatusSinglePlayer(ContextNormal c) {
		context = c;
		this.colors = context.colors;
		initComponents();
	}

	private void updateAll() {
		if (!SwingUtilities.isEventDispatchThread()) {
			SwingUtilities.invokeLater(new Runnable() {

				@Override
				public void run() {
					updateAll();
				}
			});
		} else {
			jLabel_bonus.setText(bonus);
			jLabel_credits.setText(credits);
			jLabel_interest.setText(interest);
			jLabel_lives.setText(lives);
			jLabel_score.setText(score);
			jLabel_wave.setText(wave);
		}
	}

	public void setBonus(String bonus) {
		this.bonus = bonus;
		updateAll();
	}

	public void setCredits(String credits) {
		this.credits = credits;
		updateAll();
	}

	public void setInterest(String interest) {
		this.interest = interest;
		updateAll();
	}

	public void setLives(String lives) {
		this.lives = lives;
		updateAll();
	}

	public void setScore(String score) {
		this.score = score;
		updateAll();
	}

	public void setWave(String wave) {
		this.wave = wave;
		updateAll();
	}

	/** This method is called from within the constructor to
	 * initialize the form.
	 * WARNING: Do NOT modify this code. The content of this method is
	 * always regenerated by the Form Editor.
	 */
	@SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {
        java.awt.GridBagConstraints gridBagConstraints;

        jLabel1 = new javax.swing.JLabel();
        jLabel_wave = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel_credits = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel_lives = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jLabel_interest = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel_bonus = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jLabel_score = new javax.swing.JLabel();

        setBackground(colors.getColorBackGround());
        setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Status", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Bitstream Vera Sans", 0, 13), colors.getColorForeGround())); // NOI18N
        setForeground(colors.getColorForeGround());
        setLayout(new java.awt.GridBagLayout());

        jLabel1.setBackground(colors.getColorBackGround());
        jLabel1.setForeground(colors.getColorForeGround());
        jLabel1.setText("Wave:");
        jLabel1.setFocusable(false);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
        gridBagConstraints.insets = new java.awt.Insets(0, 2, 0, 2);
        add(jLabel1, gridBagConstraints);

        jLabel_wave.setBackground(colors.getColorBackGround());
        jLabel_wave.setForeground(colors.getColorForeGround());
        jLabel_wave.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        jLabel_wave.setText("xx/xx");
        jLabel_wave.setFocusable(false);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
        gridBagConstraints.insets = new java.awt.Insets(0, 2, 0, 2);
        add(jLabel_wave, gridBagConstraints);

        jLabel3.setBackground(colors.getColorBackGround());
        jLabel3.setForeground(colors.getColorForeGround());
        jLabel3.setText("Cash:");
        jLabel3.setFocusable(false);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
        gridBagConstraints.insets = new java.awt.Insets(0, 2, 0, 2);
        add(jLabel3, gridBagConstraints);

        jLabel_credits.setBackground(colors.getColorBackGround());
        jLabel_credits.setForeground(colors.getColorForeGround());
        jLabel_credits.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        jLabel_credits.setText("000000");
        jLabel_credits.setFocusable(false);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.gridwidth = 3;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
        gridBagConstraints.insets = new java.awt.Insets(0, 2, 0, 0);
        add(jLabel_credits, gridBagConstraints);

        jLabel6.setBackground(colors.getColorBackGround());
        jLabel6.setForeground(colors.getColorForeGround());
        jLabel6.setText("Lives:");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
        gridBagConstraints.insets = new java.awt.Insets(0, 2, 0, 2);
        add(jLabel6, gridBagConstraints);

        jLabel_lives.setBackground(colors.getColorBackGround());
        jLabel_lives.setForeground(colors.getColorForeGround());
        jLabel_lives.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        jLabel_lives.setText("xx");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
        gridBagConstraints.insets = new java.awt.Insets(0, 2, 0, 2);
        add(jLabel_lives, gridBagConstraints);

        jLabel8.setBackground(colors.getColorBackGround());
        jLabel8.setForeground(colors.getColorForeGround());
        jLabel8.setText("Interest:");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 2;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
        gridBagConstraints.insets = new java.awt.Insets(0, 2, 0, 2);
        add(jLabel8, gridBagConstraints);

        jLabel_interest.setBackground(colors.getColorBackGround());
        jLabel_interest.setForeground(colors.getColorForeGround());
        jLabel_interest.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        jLabel_interest.setText("x%");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 3;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
        gridBagConstraints.insets = new java.awt.Insets(0, 2, 0, 2);
        add(jLabel_interest, gridBagConstraints);

        jLabel5.setBackground(colors.getColorBackGround());
        jLabel5.setForeground(colors.getColorForeGround());
        jLabel5.setText("Bonus:");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 2;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
        gridBagConstraints.insets = new java.awt.Insets(0, 2, 0, 2);
        add(jLabel5, gridBagConstraints);

        jLabel_bonus.setBackground(colors.getColorBackGround());
        jLabel_bonus.setForeground(colors.getColorForeGround());
        jLabel_bonus.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        jLabel_bonus.setText("0");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 3;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
        gridBagConstraints.insets = new java.awt.Insets(0, 2, 0, 2);
        add(jLabel_bonus, gridBagConstraints);

        jLabel9.setBackground(colors.getColorBackGround());
        jLabel9.setForeground(colors.getColorForeGround());
        jLabel9.setText("Score:");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
        gridBagConstraints.insets = new java.awt.Insets(0, 2, 0, 2);
        add(jLabel9, gridBagConstraints);

        jLabel_score.setBackground(colors.getColorBackGround());
        jLabel_score.setForeground(colors.getColorForeGround());
        jLabel_score.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        jLabel_score.setText("0000000");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.gridwidth = 3;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
        gridBagConstraints.insets = new java.awt.Insets(0, 2, 0, 0);
        add(jLabel_score, gridBagConstraints);
    }// </editor-fold>//GEN-END:initComponents
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JLabel jLabel_bonus;
    private javax.swing.JLabel jLabel_credits;
    private javax.swing.JLabel jLabel_interest;
    private javax.swing.JLabel jLabel_lives;
    private javax.swing.JLabel jLabel_score;
    private javax.swing.JLabel jLabel_wave;
    // End of variables declaration//GEN-END:variables
}
